<?php

/**
 * Generated Model class.
 */
class Base_LogPeer extends Db_Peer implements ISingleton
{

    const ID = '`log`.`id`';

    const USER_ID = '`log`.`user_id`';

    const USER_NAME = '`log`.`user_name`';

    const ACTION = '`log`.`action`';

    const MESSAGE = '`log`.`message`';

    const PRIORITY = '`log`.`priority`';

    const PRIORITYNAME = '`log`.`priorityName`';

    const TIMESTAMP = '`log`.`timestamp`';

    protected $_name = 'log';

    protected $_rowClass = 'LogRow';

    protected $_dependentTables = array();

    protected $_referenceMap = array();

    private static $_instance = null;

    protected $_metadata = array(
        'id' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'log',
            'COLUMN_NAME' => 'id',
            'COLUMN_POSITION' => 1,
            'DATA_TYPE' => 'int',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => true,
            'PRIMARY_POSITION' => 1,
            'IDENTITY' => true
            ),
        'user_id' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'log',
            'COLUMN_NAME' => 'user_id',
            'COLUMN_POSITION' => 2,
            'DATA_TYPE' => 'int',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'user_name' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'log',
            'COLUMN_NAME' => 'user_name',
            'COLUMN_POSITION' => 3,
            'DATA_TYPE' => 'varchar',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => '155',
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'action' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'log',
            'COLUMN_NAME' => 'action',
            'COLUMN_POSITION' => 4,
            'DATA_TYPE' => 'varchar',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => '255',
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'message' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'log',
            'COLUMN_NAME' => 'message',
            'COLUMN_POSITION' => 5,
            'DATA_TYPE' => 'text',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'priority' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'log',
            'COLUMN_NAME' => 'priority',
            'COLUMN_POSITION' => 6,
            'DATA_TYPE' => 'int',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'priorityName' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'log',
            'COLUMN_NAME' => 'priorityName',
            'COLUMN_POSITION' => 7,
            'DATA_TYPE' => 'varchar',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => '100',
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'timestamp' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'log',
            'COLUMN_NAME' => 'timestamp',
            'COLUMN_POSITION' => 8,
            'DATA_TYPE' => 'timestamp',
            'DEFAULT' => 'CURRENT_TIMESTAMP',
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            )
        );

    /**
     * @return LogPeer
     */
    public static function getInstance()
    {
        if (!self::$_instance) {
        	self::$_instance = new LogPeer();
        }
        return self::$_instance;
    }

    /**
     * @return Db_Rowset
     */
    public function findById($id)
    {
        $select = $this->select();
        $select->where('`id` = ?', $id);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByUserId($user_id)
    {
        $select = $this->select();
        $select->where('`user_id` = ?', $user_id);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByUserName($user_name)
    {
        $select = $this->select();
        $select->where('`user_name` = ?', $user_name);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByAction($action)
    {
        $select = $this->select();
        $select->where('`action` = ?', $action);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByMessage($message)
    {
        $select = $this->select();
        $select->where('`message` = ?', $message);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByPriority($priority)
    {
        $select = $this->select();
        $select->where('`priority` = ?', $priority);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByPriorityName($priorityName)
    {
        $select = $this->select();
        $select->where('`priorityName` = ?', $priorityName);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByTimestamp($timestamp)
    {
        $select = $this->select();
        $select->where('`timestamp` = ?', $timestamp);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }


}

